﻿<Window x:Class="SStuff.WpfPlaneProjSample.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:fx="clr-namespace:SStuff.WpfEffects;assembly=SStuff.WpfEffects"
        xmlns:local="clr-namespace:SStuff.WpfPlaneProjSample" xmlns:Media="clr-namespace:System.Windows.Media;assembly=SStuff.WpfEffects" Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="150" />
        </Grid.ColumnDefinitions>

        <Border Background="Transparent"  x:Name="border">
            <Media:PlaneProjection.PlaneProjection>
                <Media:PlaneProjection/>
            </Media:PlaneProjection.PlaneProjection>
            <Grid Margin="50">
                
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Rectangle Grid.Row="0" Grid.Column="0" Fill="Black" MouseEnter="Rectangle_MouseEnter" MouseLeave="Rectangle_MouseLeave" />
                <Rectangle Grid.Row="0" Grid.Column="1" Fill="Lime" MouseEnter="Rectangle_MouseEnter" MouseLeave="Rectangle_MouseLeave" />
                <Rectangle Grid.Row="0" Grid.Column="2" Fill="Blue" MouseEnter="Rectangle_MouseEnter" MouseLeave="Rectangle_MouseLeave" />
                <Rectangle Grid.Row="1" Grid.Column="0" Fill="Cyan" MouseEnter="Rectangle_MouseEnter" MouseLeave="Rectangle_MouseLeave" />
                <Rectangle Grid.Row="1" Grid.Column="1" Fill="Yellow" MouseEnter="Rectangle_MouseEnter" MouseLeave="Rectangle_MouseLeave" />
                <Rectangle Grid.Row="1" Grid.Column="2" Fill="Magenta" MouseEnter="Rectangle_MouseEnter" MouseLeave="Rectangle_MouseLeave" />
                <Rectangle Grid.Row="2" Grid.Column="0" Fill="#FF7B7B00" MouseEnter="Rectangle_MouseEnter" MouseLeave="Rectangle_MouseLeave" />
                <Rectangle Grid.Row="2" Grid.Column="1" Fill="#FF007371" MouseEnter="Rectangle_MouseEnter" MouseLeave="Rectangle_MouseLeave" />
                <Rectangle Grid.Row="2" Grid.Column="2" Fill="#FF006C00" MouseEnter="Rectangle_MouseEnter" MouseLeave="Rectangle_MouseLeave" />
            </Grid>
        </Border>
        
        <StackPanel Grid.Column="1">
            <TextBlock Text="GlobalOffsetX" />
            <Slider x:Name="offsetX" Minimum="-200" Maximum="200" 
                    Value="{Binding ElementName=border, Mode=TwoWay, Path=(Media:PlaneProjection.PlaneProjection).GlobalOffsetX}" />
            <TextBlock Text="GlobalOffsetY" />
            <Slider x:Name="offsetY" Minimum="-200" Maximum="200" 
                    Value="{Binding ElementName=border, Mode=TwoWay, Path=(Media:PlaneProjection.PlaneProjection).GlobalOffsetY}" />
            <TextBlock Text="GlobalOffsetZ" />
            <Slider x:Name="offsetZ" Minimum="-200" Maximum="200"  
                    Value="{Binding ElementName=border, Mode=TwoWay, Path=(Media:PlaneProjection.PlaneProjection).GlobalOffsetZ}" />
            <TextBlock Text="RotationX" />
            <Slider x:Name="rotationX" Minimum="-180" Maximum="180"
                    Value="{Binding ElementName=border, Mode=TwoWay, Path=(Media:PlaneProjection.PlaneProjection).RotationX}" />
            <TextBlock Text="RotationY" />
            <Slider x:Name="rotationY" Minimum="-180" Maximum="180" 
                    Value="{Binding ElementName=border, Mode=TwoWay, Path=(Media:PlaneProjection.PlaneProjection).RotationY}" />
            <TextBlock Text="RotationZ" />
            <Slider x:Name="rotationZ" Minimum="-180" Maximum="180" 
                    Value="{Binding ElementName=border, Mode=TwoWay, Path=(Media:PlaneProjection.PlaneProjection).RotationZ}" />
        </StackPanel>
    </Grid>
</Window>
